<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="../_template.xhtml">


	<ui:define name="conteudo">
		<h:form id="quarto">
		<h:messages />
			<p:messages autoUpdate="true" />
			<p:growl autoUpdate="true" />

			<p:fieldset legend="Dados da categoria">
				<p:message for="nome" id="messageNome" />

				<p:panelGrid columns="2">

					<h:outputLabel value="Nome da Categoria: " for="nome" />
					<p:inputText id="nome" value="#{categoriaBean.categoria.categoria}"
						required="true" requiredMessage="Nome Obrigatório">
						<f:validateLength minimum="1" maximun="25" />
						<f:ajax event="blur" render="messageNome" />
					</p:inputText>

					<h:outputLabel value="Valor Diária: " for="valDiaria" />
					<p:inputText id="valDiaria"
						value="#{categoriaBean.categoria.valor}" required="true"
						requiredMessage="Valor Obrigatório">
						<f:validateLength minimum="5" maximum="90" />
					</p:inputText>

					<h:outputLabel value="Capacidade: " for="capacidade" />
					<p:inputText id="capacidade"
						value="#{categoriaBean.categoria.capacidade}" required="true"
						requiredMessage="Capacidade Obrigatória">
						<f:validateLength minimum="1" maximum="8" />
					</p:inputText>
				</p:panelGrid>
				<p:commandButton value="Gravar" action="#{categoriaBean.gravar}" ajax="false"/>
			</p:fieldset>
		</h:form>
	</ui:define>

</ui:composition>


</html>